home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Devices.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  8.6 KB  |  287 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Devices.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
  18. __DEVICES__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  22.     include 'OSUtils.a'
  23.     ENDIF
  24. ;        include 'Types.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'MixedMode.a'                                        ;
  27. ;        include 'Memory.a'                                            ;
  28.  
  29.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  30.     include 'Files.a'
  31.     ENDIF
  32.  
  33.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  34.     include 'Quickdraw.a'
  35.     ENDIF
  36. ;        include 'QuickdrawText.a'                                    ;
  37.  
  38.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  39.     include 'Events.a'
  40.     ENDIF
  41.  
  42.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  43.     include 'Dialogs.a'
  44.     ENDIF
  45. ;        include 'Errors.a'                                            ;
  46. ;        include 'Windows.a'                                        ;
  47. ;            include 'Controls.a'                                    ;
  48. ;                include 'Menus.a'                                    ;
  49. ;        include 'TextEdit.a'                                        ;
  50.  
  51. chooserInitMsg                    EQU        11                    ; the user selected this device package 
  52. newSelMsg                        EQU        12                    ; the user made new device selections 
  53. fillListMsg                        EQU        13                    ; fill the device list with choices 
  54. getSelMsg                        EQU        14                    ; mark one or more choices as selected 
  55. selectMsg                        EQU        15                    ; the user made a selection 
  56. deselectMsg                        EQU        16                    ; the user canceled a selection 
  57. terminateMsg                    EQU        17                    ; allows device package to clean up 
  58. buttonMsg                        EQU        19                    ; the user selected a button 
  59.  
  60. ; Values of the 'caller' parameter to a Chooser device package 
  61. chooserID                        EQU        1
  62.  
  63. ; Values of the 'message' parameter to a Control Panel 'cdev' 
  64. initDev                            EQU        0                    ;Time for cdev to initialize itself
  65. hitDev                            EQU        1                    ;Hit on one of my items
  66. closeDev                        EQU        2                    ;Close yourself
  67. nulDev                            EQU        3                    ;Null event
  68. updateDev                        EQU        4                    ;Update event
  69. activDev                        EQU        5                    ;Activate event
  70. deactivDev                        EQU        6                    ;Deactivate event
  71. keyEvtDev                        EQU        7                    ;Key down/auto key
  72. macDev                            EQU        8                    ;Decide whether or not to show up
  73. undoDev                            EQU        9
  74. cutDev                            EQU        10
  75. copyDev                            EQU        11
  76. pasteDev                        EQU        12
  77. clearDev                        EQU        13
  78. cursorDev                        EQU        14
  79.  
  80. ; Special values a Control Panel 'cdev' can return 
  81. cdevGenErr                        EQU        -1                    ;General error; gray cdev w/o alert
  82. cdevMemErr                        EQU        0                    ;Memory shortfall; alert user please
  83. cdevResErr                        EQU        1                    ;Couldn't get a needed resource; alert
  84. cdevUnset                        EQU        3                    ; cdevValue is initialized to this
  85.  
  86. ; Values of the 'message' parameter to a Monitor 'mntr' 
  87. initMsg                            EQU        1                    ;initialization
  88. okMsg                            EQU        2                    ;user clicked OK button
  89. cancelMsg                        EQU        3                    ;user clicked Cancel button
  90. hitMsg                            EQU        4                    ;user clicked control in Options dialog
  91. nulMsg                            EQU        5                    ;periodic event
  92. updateMsg                        EQU        6                    ;update event
  93. activateMsg                        EQU        7                    ;not used
  94. deactivateMsg                    EQU        8                    ;not used
  95. keyEvtMsg                        EQU        9                    ;keyboard event
  96. superMsg                        EQU        10                    ;show superuser controls
  97. normalMsg                        EQU        11                    ;show only normal controls
  98. startupMsg                        EQU        12                    ;code has been loaded
  99.  
  100. ; control codes for DeskAccessories 
  101. goodbye                            EQU        -1                    ; heap being reinitialized 
  102. killCode                        EQU        1                    ; KillIO requested 
  103. accEvent                        EQU        64                    ; handle an event 
  104. accRun                            EQU        65                    ; time for periodic action 
  105. accCursor                        EQU        66                    ; change cursor shape 
  106. accMenu                            EQU        67                    ; handle menu item 
  107. accUndo                            EQU        68                    ; handle undo command 
  108. accCut                            EQU        70                    ; handle cut command 
  109. accCopy                            EQU        71                    ; handle copy command 
  110. accPaste                        EQU        72                    ; handle paste command 
  111. accClear                        EQU        73                    ; handle clear command 
  112.  
  113. ; miscellaneous Device Manager constants 
  114. ioInProgress                    EQU        1                    ; predefined value of ioResult while I/O is pending 
  115. aRdCmd                            EQU        2                    ; low byte of ioTrap for Read calls 
  116. aWrCmd                            EQU        3                    ; low byte of ioTrap for Write calls 
  117. asyncTrpBit                        EQU        10                    ; trap word modifier 
  118. noQueueBit                        EQU        9                    ; trap word modifier 
  119.  
  120. ; flags used in the driver header and device control entry 
  121. dReadEnable                        EQU        0                    ; set if driver responds to read requests 
  122. dWritEnable                        EQU        1                    ; set if driver responds to write requests 
  123. dCtlEnable                        EQU        2                    ; set if driver responds to control requests 
  124. dStatEnable                        EQU        3                    ; set if driver responds to status requests 
  125. dNeedGoodBye                    EQU        4                    ; set if driver needs time for performing periodic tasks 
  126. dNeedTime                        EQU        5                    ; set if driver needs time for performing periodic tasks 
  127. dNeedLock                        EQU        6                    ; set if driver must be locked in memory as soon as it is opened 
  128. dNeedLockMask                    EQU        $4000                ; set if driver must be locked in memory as soon as it is opened 
  129. dNeedTimeMask                    EQU        $2000                ; set if driver needs time for performing periodic tasks 
  130. dNeedGoodByeMask                EQU        $1000                ; set if driver needs to be called before the application heap is initialized 
  131. dStatEnableMask                    EQU        $0800                ; set if driver responds to status requests 
  132. dCtlEnableMask                    EQU        $0400                ; set if driver responds to control requests 
  133. dWritEnableMask                    EQU        $0200                ; set if driver responds to write requests 
  134. dReadEnableMask                    EQU        $0100                ; set if driver responds to read requests 
  135.  
  136. ; run-time flags used in the device control entry 
  137. dOpened                            EQU        5                    ; driver is open 
  138. dRAMBased                        EQU        6                    ; dCtlDriver is a handle (1) or pointer (0) 
  139. drvrActive                        EQU        7                    ; driver is currently processing a request 
  140. drvrActiveMask                    EQU        $0080                ; driver is currently processing a request 
  141. dRAMBasedMask                    EQU        $0040                ; dCtlDriver is a handle (1) or pointer (0) 
  142. dOpenedMask                        EQU        $0020                ; driver is open 
  143.  
  144. DRVRHeader                 RECORD    0
  145. drvrFlags                 ds.w    1
  146. drvrDelay                 ds.w    1
  147. drvrEMask                 ds.w    1
  148. drvrMenu                 ds.w    1
  149. drvrOpen                 ds.w    1
  150. drvrPrime                 ds.w    1
  151. drvrCtl                     ds.w    1
  152. drvrStatus                 ds.w    1
  153. drvrClose                 ds.w    1
  154. drvrName                 ds.b    1
  155. sizeof                     EQU    20
  156.                         ENDR
  157.  
  158. DCtlEntry                 RECORD    0
  159. dCtlDriver                 ds.l    1
  160. dCtlFlags                 ds.w    1
  161. dCtlQHdr                 ds        QHdr
  162. dCtlPosition             ds.l    1
  163. dCtlStorage                 ds.l    1
  164. dCtlRefNum                 ds.w    1
  165. dCtlCurTicks             ds.l    1
  166. dCtlWindow                 ds.l    1
  167. dCtlDelay                 ds.w    1
  168. dCtlEMask                 ds.w    1
  169. dCtlMenu                 ds.w    1
  170. sizeof                     EQU    40
  171.                         ENDR
  172.  
  173. AuxDCE                     RECORD    0
  174. dCtlDriver                 ds.l    1
  175. dCtlFlags                 ds.w    1
  176. dCtlQHdr                 ds        QHdr
  177. dCtlPosition             ds.l    1
  178. dCtlStorage                 ds.l    1
  179. dCtlRefNum                 ds.w    1
  180. dCtlCurTicks             ds.l    1
  181. dCtlWindow                 ds.l    1
  182. dCtlDelay                 ds.w    1
  183. dCtlEMask                 ds.w    1
  184. dCtlMenu                 ds.w    1
  185. dCtlSlot                 ds.b    1
  186. dCtlSlotId                 ds.b    1
  187. dCtlDevBase                 ds.l    1
  188. dCtlOwner                 ds.l    1
  189. dCtlExtDev                 ds.b    1
  190. fillByte                 ds.b    1
  191. dCtlNodeID                 ds.l    1
  192. sizeof                     EQU    56
  193.                         ENDR
  194.  
  195. ;
  196. ;    SetChooserAlert used to simply set a bit in a low-mem global
  197. ;    to tell the Chooser not to display its warning message when
  198. ;    the printer is changed. However, under MultiFinder and System 7,
  199. ;    this low-mem is swapped out when a layer change occurs, and the
  200. ;    Chooser never sees the change. It is obsolete, and completely
  201. ;    unsupported on the PowerPC. 68K apps can still call it if they
  202. ;    wish.
  203. ;
  204.     IF OLDROUTINENAMES  ** ¬ GENERATINGCFM  THEN
  205.     ENDIF
  206. ;
  207. ;  Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  208. ;          There will soon be a DriverInstall() which does the right thing.
  209. ;
  210. ;        DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  211. ;        still exports DrvrRemove, so a macro is used to map the new name to old.
  212. ;
  213. ;
  214.     IF GENERATING68K THEN
  215.         _DrvrRemove:    OPWORD    $A03E
  216.     ELSE
  217.         IMPORT    DrvrRemove
  218.     ENDIF
  219.  
  220.     IF GENERATING68K THEN
  221.         _PBControlSync:    OPWORD    $A004
  222.     ELSE
  223.         IMPORT    PBControlSync
  224.     ENDIF
  225.  
  226.     IF GENERATING68K THEN
  227.         _PBControlAsync:    OPWORD    $A404
  228.     ELSE
  229.         IMPORT    PBControlAsync
  230.     ENDIF
  231.  
  232.     IF GENERATING68K THEN
  233.         _PBControlImmed:    OPWORD    $A204
  234.     ELSE
  235.         IMPORT    PBControlImmed
  236.     ENDIF
  237.  
  238.     IF GENERATING68K THEN
  239.         _PBStatusSync:    OPWORD    $A005
  240.     ELSE
  241.         IMPORT    PBStatusSync
  242.     ENDIF
  243.  
  244.     IF GENERATING68K THEN
  245.         _PBStatusAsync:    OPWORD    $A405
  246.     ELSE
  247.         IMPORT    PBStatusAsync
  248.     ENDIF
  249.  
  250.     IF GENERATING68K THEN
  251.         _PBStatusImmed:    OPWORD    $A205
  252.     ELSE
  253.         IMPORT    PBStatusImmed
  254.     ENDIF
  255.  
  256.     IF GENERATING68K THEN
  257.         _PBKillIOSync:    OPWORD    $A006
  258.     ELSE
  259.         IMPORT    PBKillIOSync
  260.     ENDIF
  261.  
  262.     IF GENERATING68K THEN
  263.         _PBKillIOAsync:    OPWORD    $A406
  264.     ELSE
  265.         IMPORT    PBKillIOAsync
  266.     ENDIF
  267.  
  268.     IF GENERATING68K THEN
  269.         _PBKillIOImmed:    OPWORD    $A206
  270.     ELSE
  271.         IMPORT    PBKillIOImmed
  272.     ENDIF
  273.  
  274.     IF GENERATING68K THEN
  275.         _OpenDeskAcc:    OPWORD    $A9B6
  276.     ELSE
  277.         IMPORT    OpenDeskAcc
  278.     ENDIF
  279.  
  280.     IF GENERATING68K THEN
  281.         _CloseDeskAcc:    OPWORD    $A9B7
  282.     ELSE
  283.         IMPORT    CloseDeskAcc
  284.     ENDIF
  285.  
  286.     ENDIF ; __DEVICES__
  287.